package com.org.gsc.zsqdemos;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.org.gsc.zsqdemos.uis.MagicindicatorMTestDemo;
import com.org.gsc.zsqdemos.uis.PageIndicatiorDemo;
import com.org.gsc.zsqdemos.uis.PstDemo;
import com.org.gsc.zsqdemos.uis.SlidingTabLayoutDemo;
import com.org.gsc.zsqdemos.uis.SmartTabLayoutDemos;
import com.org.gsc.zsqdemos.uis.TabDemo;

public class MainActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
private ListView lv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);
        lv= (ListView) findViewById(R.id.lv);
        String[] mdatas={"PagerSlidingTabStrip","TabLayout MD","ViewPagerIndicator","magicindicator","SlidingTabLayout","SmartTabLayout"};
        lv.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,android.R.id.text1,mdatas));
        lv.setOnItemClickListener(this);
    }
 Class [] classes={PstDemo.class,TabDemo.class,PageIndicatiorDemo.class,MagicindicatorMTestDemo.class,SlidingTabLayoutDemo.class, SmartTabLayoutDemos.class};
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        startActivity(new Intent(this,classes[position]));

    }
}
